<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>国省自检--${fns:getConfig('productName')}</title>
<link rel="stylesheet" href="${ctx}/styles/gsjcss/common.css">
<script src="${ctxStatic}/js/check/checkCommon.js"
	type="text/javascript"></script>
<script type="text/javascript">
    function btnClick(){
        var url = '${ctx}/couRoadCon/search.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}';
        var data = {};
           data['retrieval'] = getJson('condition');
           loadData(url,data);
        }
    //ajax执行成功之后的回调方法
    function loadDataToTable(data){
        var attData = data['att'];
        var score = data['score'];
        var scoreOne = data['scoreOne'];
        var percent = data['percent'];
        var checkTime = data['checkTime'];
        var itemSum = data['itemSum'];
        var workNum = data['workNum'];
        var completeNum = data['completeNum'];
        var acceptNum = data['acceptNum'];
        var xxRoadBLists = data['xxRoadBLists'];
        var scoreTwo = data['scoreTwo'];
        //检索附件的回调方法
        loadAttachment(attData);
      	//评分表一：
      	if(data['flagOne']){
      		var contentOne = '<table style="width:98%; height:31px;text-align:center;margin-top:5px;" border="1"><thead><tr style="height:31px">'+
					            '<th>年度</th>'+
					            '<th>项目总数</th>'+
					            '<th>开工比例</th>'+
					            '<th>完工比例</th>'+
					            '<th>验收比例</th>'+
					            '<th>手续是否完善（是/否）</th>'+
					            '<th>检查得分</th>'+
					            '<th>检查总分</th>'+
					            '<th>完善度</th></thead></tr><tbody>';
				contentOne += '<tr style="height:30px">';
				contentOne += '<td>'+ checkTime +'</td><td>'+itemSum+'</td><td>'+workNum+'%</td><td>'+completeNum+'%</td><td>'+acceptNum+'%</td>';
				if (data['ifPerfect']){
				contentOne += '<td>'+"手续完善"+'</td>';
				} else {
				contentOne += '<td>'+"手续不完善"+'</td>';
				}
				contentOne += '<td>'+scoreOne+'</td>';
				contentOne += '<td class="sumTd">'+score+'</td>';
				contentOne += '<td class="perTd">'+percent+'%</td>';
				contentOne += '</tr></tbody></table>';
				$('#checkResult').append(contentOne);
      	} 	
      	   $('#checkResult #message').empty();
      //评分表二：
      if (data['flagTwo']){
    	  var tr="";
    	  var contentTwo = '<div id="message" style="margin-top:10px;">提示：下面数据为实地检查，默认满分</div>';
    	 	  contentTwo += '<table id="twoTable" style="width:98%; height:31px;text-align:center;margin-top:5px;" border="1"><thead><tr style="height:31px">'+
        						'<th>序号</th>'+
        						'<th>项目名称</th>'+
        						'<th>年份</th>'+
        						'<th>计划规模</th>'+
        						'<th>实施情况</th>'+
        						'<th>验收情况</th>'+
        						'<th>检查得分</th></thead></tr><tbody>';
        	for(var i=0; i < xxRoadBLists.length; i++){
        		tr +='<tr><td>'+(i+1)+'</td><td>'+xxRoadBLists[i].projectName+'</td><td>'+xxRoadBLists[i].year+'</td><td>'+"与计划一致"+'</td><td>'+"与计划一致"+'</td><td>'+"与计划一致"+'</td><td>'+scoreTwo+'</td></tr>';
        	}
       		contentTwo += tr + '</tbody></table>';
       		$('#checkResult').append(contentTwo);
       	}
     }
</script>
</head>
<body>
	<div id="x_top"></div>
	<tags:message content="${msg}" />
	<c:if test="${not empty checkTable.id}">
		<div style="text-align:center">
			<a href="javascript:void(0);" class="btn btn-primary" onclick="downWord('${ctx}/couRoadCon/downWord.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}');" id= "btnDown" role="button" ><div id="x_v"></div></a>
		</div>
	</c:if>
	<form id="checkForm" class="form-horizontal" method="POST" name="checkForm"	action="${ctx}/couRoadCon/save.do?left=${fns:encodeParam(left)}&parentId=${fns:encodeParam(parentId)}&projectId=${fns:encodeParam(projectId)}&menuId=${fns:encodeParam(menuId)}">
		<input type="hidden" name="token" value="${token}">
		<div id="show">
			<div id="showTable" class="showTable">
				<jsp:include page="/WEB-INF/views/check/common.jsp" />
				<div class="model">
					<div>
						<legend>三、检查条件及设置</legend>
						<div class="content-title" id="condition">
							<div style="float:left;margin-right:10px;">
								<div>
									<div>
		                        		<span>选择部、省补助县乡公路工程项目<font style="color:red;">*</font>：</span>
										<tags:treeselect id="office" name="itemProjectId" value="" labelName="objectName" labelValue=""
											title="单位" url="/couRoadCon/couRoadConData.do?projectId=${projectId}" allowClear="true" checked ="true"/>
                            		</div>
								</div>
								<div  style="margin-top:20px">
									<span>基建程序均满足要求得分<font style="color:red;">*</font>：</span>
		                        		<input type="text" name="yearPart" id="yearPart"  maxlength="6" class="required conInput" value='4'>
									<span style="margin-left: 15px;">每个部、省补助县乡公路工程项目满足要求得分<font style="color:red;">*</font>：</span>
		                        		<input type="text" name="poitMark" id="poitMark"  maxlength="6" class="required conInput" value='4'>
								</div>
		                        <div style="margin-top:20px">
		                        	<span>项目100%开工可得<font style="color:red;">*</font>：</span>
		                        		<input type="text" name="reserveMark" id="reserveMark"  maxlength="6" class="required conInput" value='5'>
		                        	<span style="margin-left: 15px;">项目90%及以上完工可得<font style="color:red;">*</font>：</span>
		                        		<input type="text" name="firstStepScore" id="firstStepScore"  maxlength="6" class="required conInput" value='3'>
									<span style="margin-left: 15px;">项目90%及以上验收可得<font style="color:red;">*</font>：</span>
		                        		<input type="text" name="secondStepScore" id="secondStepScore"  maxlength="6" class="required conInput" value='3'>
		                        </div>
		                        <div style="margin-top:20px">
		                        	<span>开工率每降低1个百分点扣分<font style="color:red;">*</font>：</span>
		                        		<input type="text" name="thirdStepScore" id="thirdStepScore"  maxlength="6" class="required conInput" value='0.1'>
									<span style="margin-left: 8px;">完工率每降低1个百分点扣分<font style="color:red;">*</font>：</span>
		                        		<input type="text" name="fourthStepScore" id="fourthStepScore"  maxlength="6" class="required conInput" value='0.05'>
									<span style="margin-left: 8px;">验收率每降低1个百分点扣分<font style="color:red;">*</font>：</span>
	                        			<input type="text" name="fifthStepScore" id="fifthStepScore"  maxlength="6" class="required conInput" value='0.05'>
		                        </div>
                      		</div>
	                        <div id="x_s" style="float:right">
									<div class="x_ico"></div>
									<a href="#javascript:void(0)" onclick= "btnClick();"  id= "btnSearch" role="button">搜索&nbsp;</a>
							</div>
						</div>
					</div>
				</div>
				<div class="model">
					<div>
						<legend>四、检索结果</legend>
						<div class="content-title">
							<div class="tabbox">
								<div class="tab">
								 <a href="javascript:;" class="on">规章制度</a>
									<c:forEach items="${childMenuList}" var="menu"
										varStatus="idxStatus">
										<c:if test="${idxStatus.index >= 3}">
											<a href="javascript:;">${menu.name}</a>
										</c:if>
									</c:forEach>
								</div>
								<div class="content">
									<ul>
										<c:forEach items="${childMenuList}" var="menu" varStatus="idxStatus">
											<c:if test="${idxStatus.index >= 2}">
												<li>
													<table style="width: 98%; text-align: center; margin-top: 5px;"	border="1" id="${menu.tag}">
														<thead>
															<th>序号</th>
															<th>操作</th>
															<th>发文单位</th>
															<th>上传用户</th>
															<th>文件名</th>
															<th>发文日期</th>
															<th>上传日期</th>
															<th>文件大小</th>
															<th>文件类型</th>
														</thead>
														<tbody>

														</tbody>
													</table>
												</li>
											</c:if>
										</c:forEach>
									</ul>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="model">
					<div>
						<legend>五、检查评分</legend>
						<div class="context-title" id="checkResult">
                           
                        </div>
					</div>
				<div class="model">
					<div class="content-btn">
						<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" />
						&nbsp;&nbsp;&nbsp;&nbsp;
						<input id="btnCancel" class="btn" type="button" value="返 回" onclick="toBack()" />
					</div>
				</div>
			</div>
		</div>
	</form>
	<script src="${ctxStatic}/js/check/checkCommon.js" type="text/javascript"></script>
</body>
</html>